package csce315.group10.androidapp;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

import android.os.Parcel;
import android.os.Parcelable;

public class PotentialStory implements Parcelable{
	/* private instance variables */
	private String story_name;
	private String story_date;
	private String story_time;
	private String contact_name;
	private String contact_phone;
	private String suggested_by;
	private String location;
	private String notes;
	public PotentialStory(@Attribute(name="name")String _story_name,@Element(name = "date",required=false)String _story_date,@Element(name = "time",required=false)String _story_time,
			@Element(name = "contact_name",required=false)String _contact_name, @Element(name = "contact_phone",required=false)String _contact_phone,@Element(name = "suggested_by")String _suggested_by,
			@Element(name = "location",required=false)String _location,@Element(name = "notes",required=false)String _notes){
		story_name = _story_name;
		story_date = _story_date;
		story_time = _story_time;
		contact_name = _contact_name;
		contact_phone = _contact_phone;
		suggested_by = _suggested_by;
		location = _location;
		notes = _notes;
	}
	/* constructor used by Parcelable */
	public PotentialStory(Parcel source){
        /*
         * Reconstruct from the Parcel
         */
        story_name = source.readString();
        story_date = source.readString();
        story_time = source.readString();
        contact_name = source.readString();
        contact_phone = source.readString();
        suggested_by = source.readString();
        location = source.readString();
        notes = source.readString();
  }
	
	/* Accessors */
	@Attribute(name = "name")
	public String get_story_name(){
    	return story_name;
    }
	@Element(name = "date",required=false)
	public String get_story_date(){
    	return story_date;
    }
	@Element(name = "time",required=false)
	public String get_story_time(){
    	return story_time;
    }
	@Element(name = "contact_name",required=false)
	public String get_con_name(){
    	return contact_name;
    }
	@Element(name = "contact_phone",required=false)
	public String get_con_phone(){
    	return contact_phone;
    }
	@Element(name = "suggested_by",required=false)
	public String get_suggested_by(){
    	return suggested_by;
    }
	@Element(name = "location",required=false)
	public String get_location(){
    	return location;
    }
	@Element(name = "notes",required=false)
	public String get_notes(){
    	return notes;
    }
	
	public int describeContents() {
		return hashCode();
	}
	/* used to serialize data to pass in an interface*/
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(story_name);
		dest.writeString(story_date);
		dest.writeString(story_time);
	    dest.writeString(contact_name);
	    dest.writeString(contact_phone);
	    dest.writeString(suggested_by);
	    dest.writeString(location);
	    dest.writeString(notes);
	}
	/* used to create an event object from Parcelable */
	public static final Parcelable.Creator CREATOR =
    	new Parcelable.Creator() {
            public PotentialStory createFromParcel(Parcel in) {
                return new PotentialStory(in);
            }
 
            public PotentialStory[] newArray(int size) {
                return new PotentialStory[size];
            }
        };
}